import { useState } from 'react';
import CodeEditor from './code-editor';
import CodeList from './code-list';

export default function CodeManagement() {
  const [selectedCode, setSelectedCode] = useState<string | null>(null);

  return selectedCode ? (
    <CodeEditor 
      initialContent={selectedCode}
      onBack={() => setSelectedCode(null)}
    />
  ) : (
    <CodeList onSelect={(code) => setSelectedCode(code)} />
  );
} 